package 作业;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: lenovo
 * Date: 2022-09-24
 * Time: 22:51
 */
public class Demo2 {
    public static void main(String[] args) {
        Thread t3 = new Thread(()->{
            System.out.println(Thread.currentThread().getName());
        },"c");
        Thread t2 = new Thread(()->{
            try {
                t3.join();
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            System.out.println(Thread.currentThread().getName());
        },"b");

        Thread t1 = new Thread(()->{
            try {
                t2.join();
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            System.out.println(Thread.currentThread().getName());
        },"a");
        t3.start();
        t2.start();
        t1.start();
    }
}
